package com.onlyyou.user.entity;

import com.onlyyou.user.info.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: 小野
 * @Date: 2020/1/12 15:34
 * 用户类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
    private Long id;
    private String username;
    private String password;
    private Integer permission;
    private String phone;
    private Date createTime;
    private Date updateTime;
    public UserInfo buildInfo() {
        UserInfo userInfo=new UserInfo();
        BeanUtils.copyProperties(this,userInfo);
        return userInfo;
    }
}
